Skip to content

Conversation

oliveror
Copy link
Member

Changes

Initial JavaScript before Explore is shown: 131.8 KB → 90.1 KB gzipped.

  • Client GraphQL operations are generated as typed query strings (documentMode: 'string') and sent as-is, so graphql (graphql-js) is removed from the browser bundle and from apps/web. Tests and scripts/test-recipe-api.ts were updated accordingly.
  • Login, Register, My Cookbook, Recipe detail and Add/Edit recipe are lazy-loaded; AppShell shows a loading state while a page chunk loads. Explore (the landing page) still loads with the app.
  • Recipe ids are validated with Zod's exact UUID regex instead of importing Zod, which had pulled the whole library into the landing bundle (verified identical on test cases).
  • Bug found while testing the combined branches, fixed here: with code splitting, Vite links page-chunk CSS before the main stylesheet. Cascade-layer priority follows first appearance, so the components layer fell below reset and primary buttons lost their white text. The layer order is now declared inline at the top of index.html; a new smoke test fails without this fix.
  • Bundle numbers are documented in docs/performance-and-images.md.

Validation

Remaining work

  • None for this issue.

AI usage

Written with Claude Code (Anthropic) during the final-delivery review. The change was implemented and tested by the AI agent and pushed from my account. Please review the diff as you would any other contribution.

Closes #83

- Generate client operations as typed query strings (codegen
  documentMode: 'string') and send them as-is, so the browser no longer
  bundles graphql-js for print(); remove graphql from apps/web.
- Lazy-load Login, Register, Cookbook, Recipe detail and Add/Edit recipe;
  AppShell shows a loading state while a page chunk loads.
- Validate recipe ids with Zod's UUID pattern instead of importing Zod,
  which kept the whole library in the landing bundle.

Initial JS for Explore: 131.8 KB -> 90.1 KB gzipped.

Closes #83
With lazy routes, Vite links page-chunk stylesheets before the main
stylesheet. Cascade layer priority follows the order layers are first
named, so the components layer landed below the reset and primary
buttons lost their white text. Declare the layer order inline at the top
of index.html, and add a smoke test that checks a code-split page.

Refs #83
CI failed in RequireAuth.test (register=true): with code splitting the
Register page loads asynchronously, and the test looked up the Name field
right after clicking the link. On the slower CI runner the chunk was not
loaded yet. Wait for the Register heading first, as the test already does
for Log in.

Refs #83
Copy link
Member

@olestan olestan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found. One minor thing:

  • GraphQL documentation (docs/recipe-api.md:59): The example still uses print(CreateRecipeDocument), which is incompatible with the new string-based documents. Update it to use .toString() and remove the graphql import.

The generated documents are now TypedDocumentString, so the example sends
CreateRecipeDocument.toString() instead of print() and no longer imports
graphql.
@oliveror
Copy link
Member Author

Thanks for the approval. The docs follow-up is done in the latest commit: the example in docs/recipe-api.md now sends CreateRecipeDocument.toString() instead of print(CreateRecipeDocument), and the graphql import is removed. I found no other mention of print(), DocumentNode or a graphql import elsewhere in docs/ or the README. This is a docs-only change; prettier --check passes.

# Conflicts:
#	e2e/smoke.spec.ts
#	scripts/test-recipe-api.ts
@oliveror oliveror merged commit 8f64572 into dev Nov 17, 2026
2 checks passed
@oliveror oliveror deleted the feature/perf-bundle-size branch November 17, 2026 00:30
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants